package com.ithiema.reggie.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 分页查询配置类
 *
 * @author wangxiao
 * @since 2022/11/1 16:54
 */
@Configuration
public class MyBatisPlusConfig {
    @Bean
    public MybatisPlusInterceptor myBatisPlusConfigInterceptor(){
//                mp的拦截器
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
//        分页拦截器
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return interceptor;
    }
}
